diff options
Diffstat (limited to 'app/[lng]/evcp/(evcp)/email-template/page.tsx')
| -rw-r--r-- | app/[lng]/evcp/(evcp)/email-template/page.tsx | 89 |
1 files changed, 72 insertions, 17 deletions
diff --git a/app/[lng]/evcp/(evcp)/email-template/page.tsx b/app/[lng]/evcp/(evcp)/email-template/page.tsx index d66b1588..7f4de341 100644 --- a/app/[lng]/evcp/(evcp)/email-template/page.tsx +++ b/app/[lng]/evcp/(evcp)/email-template/page.tsx @@ -1,22 +1,77 @@ -import { getTemplatesAction } from '@/lib/mail/service';
-import MailTemplatesClient from '@/components/mail/mail-templates-client';
-import { InformationButton } from '@/components/information/information-button';
-export default async function MailTemplatesPage() {
- // 서버에서 초기 데이터 가져오기
- const result = await getTemplatesAction();
- const initialData = result.success ? result.data : [];
+import * as React from "react"
+import { type Metadata } from "next"
+import {
+ Card,
+ CardContent,
+ CardDescription,
+ CardHeader,
+ CardTitle,
+} from "@/components/ui/card"
+import { getTemplateList } from "@/lib/email-template/service"
+import { type SearchParams } from "@/types/table"
+import { SearchParamsEmailTemplateCache } from "@/lib/email-template/validations"
+import { TemplateTable } from "@/lib/email-template/table/email-template-table"
+import { Shell } from "@/components/shell"
+import { getValidFilters } from "@/lib/data-table"
+import { Skeleton } from "@/components/ui/skeleton"
+import { DataTableSkeleton } from "@/components/data-table/data-table-skeleton"
+
+export const metadata: Metadata = {
+ title: "템플릿 관리",
+ description: "이메일 템플릿을 관리하고 편집합니다.",
+}
+
+interface TemplatePageProps {
+ searchParams: SearchParams
+}
+
+export default async function TemplatePage(props: TemplatePageProps) {
+
+ const searchParams = await props.searchParams
+
+ const search = SearchParamsEmailTemplateCache.parse(searchParams)
+ const validFilters = getValidFilters(search.filters)
+
+
+ const promises = Promise.all([
+ getTemplateList({
+ ...search,
+ filters: validFilters,
+ }),
+
+ ])
return (
- <div className="container mx-auto p-6">
- <div className="mb-8">
- <div className="flex items-center gap-2">
- <h1 className="text-3xl font-bold text-gray-900 mb-2">메일 템플릿 관리</h1>
- <InformationButton pagePath="evcp/email-template" />
+
+ <Shell className="gap-2">
+ <div className="flex items-center justify-between space-y-2">
+ <div className="flex items-center justify-between space-y-2">
+ <div>
+ <div className="flex items-center gap-2">
+ <h2 className="text-2xl font-bold tracking-tight">
+ 이메일 템플릿 관리
+ </h2>
+ {/* <InformationButton pagePath="evcp/equip-class" /> */}
+ </div>
+ </div>
</div>
- {/* <p className="text-gray-600">이메일 템플릿을 관리할 수 있습니다.</p> */}
</div>
- <MailTemplatesClient initialData={initialData} />
- </div>
- );
-}
+ <React.Suspense fallback={<Skeleton className="h-7 w-52" />}>
+ </React.Suspense>
+ <React.Suspense
+ fallback={
+ <DataTableSkeleton
+ columnCount={6}
+ searchableColumnCount={1}
+ filterableColumnCount={2}
+ cellWidths={["10rem", "40rem", "12rem", "12rem", "8rem", "8rem"]}
+ shrinkZero
+ />
+ }
+ >
+ <TemplateTable promises={promises} />
+ </React.Suspense>
+ </Shell>
+ )
+}
\ No newline at end of file |
